-- Dingo  WMS: aktualizace atributu "Urceni skladu" (nespouštět)
<g>
update sklady set useric = 1105, useru = 0, ts0 = getdate(), a303995u11011 =
  case
    when cilovySklad.ic is not null or a139132u11011 = 2 then 4
	when a139132u11011 = 3 or a139132u11011 = 5 or a139132u11011 = 7 then 6
	else 2
  end
from
  a287119u11011 sklady
  inner join a139128u11011 definice on sklady.ic_a = definice.ic and sklady.u_a = definice.u
  left outer join a152041u11011 cilovySklad on sklady.ic = cilovySklad.ic and sklady.u = cilovySklad.u
</g>

-- WMS: reset rozdeleni davky pro zdroj "Stav zasob na pozici"
<g>
update a139128u11011 set useric = 1105, useru = 0, ts0 = getdate(), a301621u11011 = null
where a301621u11011 is not null and a167269u11011 = 3
</g>

-- WMS: nastaveni udaje "Stav expirace" v definici davky
<g>
update a472020u11011 set useric = 1105, useru = 0, ts0 = getdate(), a475080u11011 = 3
where a472026u11011 = 4 and a475080u11011 is null
</g>

-- WMS: nastaveni udaje "Pozadovane mnozstvi" v definici davky
<g>
update a472020u11011 set useric = 1105, useru = 0, ts0 = getdate(), a475095u11011 = 2, a472026u11011 = 3
where a472026u11011 = 1 and a475095u11011 is null
</g>